const r = 6
const minDistance = 1;
const scaleFactorX = 0.4;
const scaleFactorY = 0.9;
// svg 初始的高宽
const svgWidth = "100%";
const svgHeight = "80%";

// 最后对原始的xy坐标进行映射
const xTimes = 17;
const xBias = 120;

const yTimes = 17;
const yBias = 10;

const randomList = (type) => {
    let dict = {};
    let count = 0;
    let randomN;
    let randomRange;
    if (type === 1) {
        randomN = 4;
        randomRange = 200;
    } else {
        randomN = 10;
        randomRange = 100;
    }
    let randKey = 0 | (1 + Math.random() * randomRange);
    let randomNumber = 0 | (2 + Math.random() * randomN);
    while (count < randomNumber) {
        let random = 0 | (Math.random() * randomRange +  1);
        if (!dict[random]) {
            dict[random] = 1;
            count ++;
        }
    }
    let list = []
    for (let key in dict) {
        list.push(key);
    }
    return [list, randKey];
}

export {
    r,
    minDistance,
    scaleFactorX,
    scaleFactorY,
    randomList,
    svgWidth,
    svgHeight,

    xTimes,
    xBias,

    yTimes,
    yBias,
}
